package com.ithe.user.pojo.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import java.util.Date;
import java.util.List;

/**
 * Created by zxd on 2022/5/12
 */
@TableName( "gxa_user")
@Data
public class User {

    @TableId(type= IdType.AUTO)
    private Long id;

    private String username;

    @JsonIgnore
    private String password;

    @JsonIgnore
    private String salt;

    private String phone;

    /**
     * 登录类型 1手机网页端  2.pc网页端   3.手机app端
     */
    @TableField("login_type")
    private Integer loginType;

    @TableField("last_login_time")
    private Date lastLoginTime;

    @TableField("pc_token")
    private String pcToken;

    @TableField("app_token")
    private String appToken;

    /**
     * 刷新token 手机端使用
     */
    @TableField("refresh_token")
    private String refreshToken;

    private String token;

    private Integer gender;

    @TableField("nick_name")
    private String nickName;

    private Date birthday;

    @TableField("avatar_url")
    private String avatarUrl;

    @TableField("open_id")
    private String openId;

    @TableField("session_key")
    private String sessionKey;

    private String city;

    private String country;

    private String language;

    private String province;

    private Integer status;
    //刷新token失效时间
    @TableField("refresh_token_expire")
    private Date  refreshTokenExpire;

    /**
     * 余额
     */
    private Long balance;

    @TableLogic(delval = "1", value = "0")
    private Integer deleted;

    @TableField(exist = false)
    private List<UserShipping> addressList;

    /**
     * 积分
     */
    //private Integer point;

}
